package com.atguigu07.encapsulation.ex1;

public class Person {
    int age;
    public void setAge(int a){
        if(a>=0&&a<=130){
            age=a;
        }else{
            System.out.println("数据非法");
        }
    }

    public int getAge() {
        return age;
    }
}
